package com.kamistoat.meimeimall.common.dubboInterface;

import com.kamistoat.meimeimall.common.To.paymentTo.PayAsyncTo;
import com.kamistoat.meimeimall.common.utils.R;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

public interface PaymentDubboInterface {

    /**
     * 收到支付成功回调后，保存支付流水
     */
    @TwoPhaseBusinessAction(name = "savePaymentInfo", commitMethod = "savePaymentInfoCommit", rollbackMethod = "savePaymentInfoRollback")
    void savePaymentInfo(BusinessActionContext businessActionContext, @BusinessActionContextParameter(paramName = "payAsyncTo") PayAsyncTo payAsyncTo);

    boolean savePaymentInfoCommit(BusinessActionContext businessActionContext);

    boolean savePaymentInfoRollback(BusinessActionContext businessActionContext);
}
